package com.jyh.service.impl;



import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jyh.dao.UserDao;
import com.jyh.entity.User;
import com.jyh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @author JYH
 * @version 1.0
 * @date 2022/11/17 16:27
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;


    @Override
    public Page findAll(int currentPage, int pageSize) {
        Page<User> page = new Page<>(currentPage,pageSize);
        Page<User> page1 = userDao.selectPage(page, null);
        return page1;
    }

    @Override
    public int deleteById(Integer uid) {
        int i = userDao.deleteById(uid);
        return i;
    }

    @Override
    public int updateById(User user) {
        int i = userDao.updateById(user);
        return i;
    }


    @Override
    public int insert(User user) {
        int insert = userDao.insert(user);
        return insert;
    }
}
